package com.hy.www.db;

import org.apache.commons.dbcp.BasicDataSource;

import javax.sql.DataSource;

/***
 * @author hy
 * @date 2018-08-10
 * @description
 *
 */
public class MyDataSource {
    public static DataSource getDataSource(String connectURI){
        BasicDataSource ds = new BasicDataSource();
        //MySQL的jdbc驱动
        ds.setDriverClassName("com.mysql.jdbc.Driver");
        ds.setUsername("root");
        ds.setPassword("root");
        ds.setUrl(connectURI);
        return ds;
    }
}
